#include <cstdio>
#include <iostream>
#include <fstream>
#include <sstream>
#include <cassert>
#include <string>
#include <cstdlib>
#include <vector>
using namespace std;

int main(int argn,char **argv){
	if(argv[1]==NULL or argv[2]==NULL or argv[3]==NULL){
		cout << "ERROR! Need 3 argument!" 
			<< "Text Black_list Output"<< endl;
		exit(1);
	}
	ifstream input(argv[1]);
	ifstream black_list(argv[2]);
	ofstream output(argv[3]);

	string str;
	vector<string> vs;
	while(getline(input,str)){
		vs.push_back(str);
	}
	
	vector<string> vb;
	while(getline(black_list,str)){
		vb.push_back(str);
	}

	for(int i=0; i<vb.size(); ++i){
		for( int j=0; j<vs.size(); ++j){
			if(vb[i]==vs[j]){
				vs[j]="";
				break;
			}
		}
	}

	for(int i=0; i<vs.size(); ++i){
		if(!vs[i].empty()){
			output << vs[i] << endl;
		}
	}
	return 0;
}
